package cn.qf.v2;

public class Vehicle {
    // 车名
    private String name;

    // 油量
    private int oil = 20;

    // 损耗度
    private int loss = 0;

    public Vehicle(String name){
        this.name = name;
    }

    public Vehicle(String name, int oil, int loss){
        this.name = name;
        this.oil = oil;
        this.loss = loss;
    }


    public String getName() {
        return name;
    }

    public int getLoss() {
        return loss;
    }

    public void setLoss(int loss) {
        this.loss = loss;
    }

    public int getOil() {
        return oil;
    }

    public void setOil(int oil) {
        this.oil = oil;
    }

    protected void show() {
        System.out.println("============");
        System.out.println("车名：" + name);
        System.out.println("油量：" + oil);
        System.out.println("损耗度：" + loss);
        System.out.println("=============");
    }
}
